MODULE MOD_DETRITUS
!******************************************************************
!***        DEFINE PARAMETERS RELATED TO DETRITUS               ***
!***   PARAMETERS ARE LISTED ALPHABETICALLY FOR EACH CATEGORY   ***
!******************************************************************
     USE MOD_1D
     IMPLICIT NONE
     SAVE
     INTEGER               :: NND                   ! TOTAL NUMBER OF BACTERIA
     INTEGER               :: IND                   ! DETRITUS INDEX USED IN VERTICAL MIXING

     REAL(SPP), ALLOCATABLE :: AGGREGATION(:,:)      ! AGGREGATION
     REAL(SPP), ALLOCATABLE :: ALPHA_BD(:,:,:)       ! FEEDING LOSS FROM BACTERIA TO DETRITUS
     REAL(SPP), ALLOCATABLE :: ALPHA_DAG(:)          ! AGGREGATION COEFFICIENT
     REAL(SPP), ALLOCATABLE :: ALPHA_DD(:,:,:)       ! FEEDING LOSS FROM DETRITUS TO DETRITUS
     REAL(SPP), ALLOCATABLE :: ALPHA_DDG(:)          ! DISAGGREGATION COEFFICIENT
     REAL(SPP), ALLOCATABLE :: ALPHA_PD(:,:,:)       ! FEEDING LOSS FROM PHYTO TO DETRITUS
     REAL(SPP), ALLOCATABLE :: ALPHA_ZD(:,:,:)       ! FEEDING LOSS FROM ZOO TO DETRITUS
     REAL(SPP), ALLOCATABLE :: BIO_D(:,:)            ! DETRITUS ABUNDANCE
     REAL(DPP), ALLOCATABLE :: DETRITE(:,:)          ! DETRITUS CONCENTRATION 
     REAL(SPP), ALLOCATABLE :: D_D(:)                ! DISSOLUTION COEFFICIENT
     REAL(SPP), ALLOCATABLE :: D_0(:)                ! DETRITUS THRESHOLD
     REAL(SPP), ALLOCATABLE :: D_RN(:)               ! REMINERALIZATION COEFFICIENT
     REAL(SPP), ALLOCATABLE :: DISAGGREGATION(:,:)   ! DISAGGREGATION
     REAL(DPP), ALLOCATABLE :: D_SINK(:,:)           ! DETRITUS SINKING FLUX
     REAL(DPP), ALLOCATABLE :: D_SINK1(:)            ! SINKING FLUX WITHIN 1 ITERATION
     REAL(SPP), ALLOCATABLE :: DISSOLUTION(:,:)      ! DISSOLUTION
     REAL(SPP), ALLOCATABLE :: EPSILON_PD(:,:)       ! PHYTO MORTALITY TO DETRITUS
     REAL(SPP), ALLOCATABLE :: EPSILON_ZD(:,:)       ! ZOO MORTALTIY TO DETRITUS
     REAL(SPP), ALLOCATABLE :: FVD(:,:)              ! DETRITUS AFTER THRESHOLD SUBSTRACTION
     REAL(SPP), ALLOCATABLE :: REMINERALIZATION(:,:) ! REMINERALIZATION   
     REAL(SPP), ALLOCATABLE :: W_D(:)                ! DETRITUS SINKING VELOCITY
     REAL(SPP), ALLOCATABLE :: W_D_TOTAL(:)          ! SINKING DISTANCE WITIN 1 T_STEP
END MODULE MOD_DETRITUS
